package com.lcke.demo.controller;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;

public class IdGenerate extends IdUtil {

    public static int nextInt() {
        Snowflake snowflake = IdUtil.getSnowflake();
        String idStr = snowflake.nextIdStr();
        String sub = StrUtil.sub(idStr, 10, 19);
        return Integer.parseInt(sub);
    }

}
